package com.proxy.router;

import com.proxy.common.model.DataNode;
import com.proxy.parser.ParsedResult;

/**
 * Created by liufish on 16/11/1.
 */
public class SQLRouteResult {

    /**
     * sql解析结果
     */
    private ParsedResult parsedResult;

    /**
     * 路由后的db节点
     */
    private DataNode[] nodes ;

    /**
     * 原有sql
     */
    private String originalSql;

    /**
     * 拆分的sql
     */
    private String [] routerSql;

    /**
     * 是否是广播表/小表/全局表
     */
    private boolean isGlobal = false;


    //是否全部都被迫走全库
    //(比如说带有某个注解 /**hit*/select * from tableA )
    private boolean isForce = false;





    public DataNode[] getNodes() {
        return nodes;
    }

    public void setNodes(DataNode[] nodes) {
        this.nodes = nodes;
    }

    public String getOriginalSql() {
        return originalSql;
    }

    public void setOriginalSql(String originalSql) {
        this.originalSql = originalSql;
    }

    public String[] getRouterSql() {
        return routerSql;
    }

    public void setRouterSql(String[] routerSql) {
        this.routerSql = routerSql;
    }


    public boolean isGlobal() {
        return isGlobal;
    }

    public void setGlobal(boolean global) {
        isGlobal = global;
    }

    public boolean isForce() {
        return isForce;
    }

    public void setForce(boolean force) {
        isForce = force;
    }

    public ParsedResult getParsedResult() {
        return parsedResult;
    }

    public void setParsedResult(ParsedResult parsedResult) {
        this.parsedResult = parsedResult;
    }
}
